
const Koa=require('koa');

const Router=require('@koa/router');

const bodyParser=require('koa-bodyparser');

const app=new Koa();//实例调用koa 生成app应用
const router=new Router();

const {
    login
}=require('./controller/user')

router.post('/api/login',login);
app.use(bodyParser());
app.use(router.routes());

app.listen(9000,()=>{//监听端口号
    console.log(`service is running at http://localhost:9000`);
})